package SQLite3;

import java.io.IOException;
import java.io.OutputStream;

class BlobW
        extends OutputStream {
    private Blob blob;
    private int pos;

    BlobW(Blob paramBlob) {
        this.blob = paramBlob;
        this.pos = 0;
    }

    public void close()
            throws IOException {
        this.blob.close();
        this.blob = null;
        this.pos = 0;
    }

    public void flush()
            throws IOException {
    }

    public void write(int paramInt)
            throws IOException {
        int i = (byte) paramInt;
        int j = this.pos;
        Blob localBlob = this.blob;
        paramInt = this.pos;
        this.pos = (j + localBlob.write(new byte[]{(byte)i}, 0, paramInt, 1));
    }

    public void write(byte[] paramArrayOfByte)
            throws IOException {
        if ((paramArrayOfByte != null) && (paramArrayOfByte.length > 0)) {
            this.pos += this.blob.write(paramArrayOfByte, 0, this.pos, paramArrayOfByte.length);
        }
    }

    public void write(byte[] paramArrayOfByte, int paramInt1, int paramInt2)
            throws IOException {
        int i;
        if (paramArrayOfByte != null) {
            i = paramInt2;
            if (paramInt1 + paramInt2 > paramArrayOfByte.length) {
                i = paramArrayOfByte.length - paramInt1;
            }
            if (i > 0) {
                //break label27;
            }
        }
        for (; ; ) {
            return;
           // label27:
            //this.pos += this.blob.write(paramArrayOfByte, paramInt1, this.pos, i);
        }
    }
}
